package com.ljx.offer;

import org.junit.Test;

/**
 * @author 李捷禧
 * Date: 2023/3/20
 * ClassName: C_53_2
 */

public class C_53_2 {
    public int missingNumber(int[] nums) {
        for (int i = 0; i < nums.length; i++) {
            if(nums[i] != i){
                return i;
            }
        }
        return nums.length;
    }

    @Test
    public void test(){
        int[] arr = new int[]{0,1,2,3,5};
        System.out.println(missingNumber(arr));

    }
}
